"""
    @File        : services.py
    @Author      : 狡猾的皮球
    @Date        : 2020/8/28 23:04
    @QQ          : 871245007
    @Description :
        创建账号的一些操作
"""
from commons.models import Player


def init_player(player: Player):
    """
    初始化玩家数据
    :param player: 玩家对象
    :return: player
    """
    player.level = 0
    player.hp = 150
    player.mp = 100
    player.atk = 10
    player.ac = 0
    player.speed = 0
    player.atk_level = 0
    player.ac_level = 0
    player.exp = 0
    player.money = 0
    player.hit = 10  # 命中
    player.dodge = 0  # 闪避
    player.crit = 10  # 暴击
    player.rcrit = 90  # 抗暴击
    player.counter = 0  # 反击
    player.rcounter = 0  # 抗反击
    player.leech = 0  # 吸血，单位百分之0.01
    return player
